<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>JavaScript变量</title>
</head>
<body>
    <h2>JavaScript变量</h2>
    <p>在本例中，x被定义为变量。然后X被赋值7；</p>
    <p id="demo"></p>
    <script>
        var x;
        x=7;
        document.getElementById("demo").innerHTML=x;
    </script>
</body>
</html>